<?php include_once('header.php'); ?>
<?php include_once('MenuView.php'); ?>
<div id="profileContent">
    <div id="teacherExamFormDiv">
        <?php echo $error;?>
        
            <input type="file" id="myFile" name="userfile" size="20" />
            <br /><br />
            <input type="button" id="upload" value="upload" />
            <progress id="prog" value="0" min="0" max="0"></progress>
        
    </div>
</div>
<script>
    var baseurl = 'http://localhost/FileCollector/';
        var courseId = $( "#courseSelect" ).val();
        var userId = <?php echo $userInfo->userId; ?>;
        
        $.ajax({
            url: baseurl+"Profesor/getBlocks",
            type: 'POST',
            async: false,
            dataType: 'text',
            data: {
                courseId_ajax : courseId,
                userId_ajax : userId
            },
            
            success: function(response) {
                //alert(response);
                var blocks = JSON.parse(response);
                $.each(blocks , function(k, block) {
                $('#blockSelect')
                    .append($("<option></option>")
                    .attr("value", block.blockId)
                    .text(block.name));
                }); 
            },
            
            error: function (xhr, ajaxOptions, thrownError) {
                alert(xhr.status);
                alert(thrownError);
                
            }
        });
       
            
    
</script>


<?php include_once('footer.php'); ?>